from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service
from fake_useragent import UserAgent
from seleniumdemo.browser import init_browser


# 初始化Chrome浏览器
browser = init_browser()

# 打开百度网页
browser.get("https://www.baidu.com")

# 这里可以编写其他与页面交互的代码
elements = browser.find_elements(By.XPATH, f'//span[@class="mnav" and contains(text(), "视频")]')
for element in elements:
    print(element.text)

# 关闭浏览器
#browser.quit()